<?php
require_once __DIR__ . "/Base_model.php";

class Host_television_typesub_model extends Base_model
{
    public function __construct()
    {
        parent::__construct();
        $this->table = "television_typesub";
    }

    /**
     * 频道话题关联列表查询
     * author: long
     */
    public function get_list($where = [], $order = '')
    {
        $this->db->select('a.*,b.id as sub_id,b.sub_title,b.sub_pic,b.online,b.is_other,b.sub_type');
        $this->db->from("$this->table as a");
        $this->db->join('type_sub as b','a.typesub_id=b.id');
        if (!empty($where)) {
            $this->db->where($where);
        }
        if(!empty($order)){
            $this->db->order_by($order);
        }else{
            $this->db->order_by('id desc');
        }
        $res = $this->db->get();
        $rows = $res->result_array();

        // echo $this->db->last_query();
        return $rows;
    }

}